// interface Box {
//     content: any; // not safe
// }

// interface Box {
//     content: unknown; // more sadfe
// }

// let x: Box = {
//     content: 'hello world'
// };

// // x.content.toUpperCase(); // 对象的类型为 "unknown"。

// if (typeof x.content === 'string') {
//     // we could check 'x.contents'
//     console.log(x.content.toUpperCase());
// }

// // or we could use a type assertion
// (x.content as string).toUpperCase();

interface NumberBox {
    contents: number;
}

interface StringBox {
    contents: string;
}

interface BooleanBox {
    contents: boolean;
}

interface Box<Type> {
    content: Type
}

let x1: Box<number>;

// x.content.toFixed();

let x2: Box<string>;
let x3: Box<boolean>;

// `Array` Type

function doSomething(value: Array<string>) {
    // ...
}

let myArray: string[] = ['hello', 'world'];

doSomething(myArray);
doSomething(new Array('hello', 'world'));


// `ReadonlyArray` Type

export {}